<style scoped src="./index.scss" lang="scss" rel="stylesheet/scss"></style>
<template src="./index.html"></template>
<script>
import OrderEvent from "@/mixin/orderEvent";
export default {
  mixins: [
    Vue.prototype.$vFN.Mixins.Base,
    Vue.prototype.$vFN.Mixins.Page,
    Vue.prototype.$vFN.Mixins.Table,
    OrderEvent,
  ],
  components: {},
  data() {
    return {
      appWindow: window,
      // 页面接口地址
      apiUrl: {
        list: "admin/order/orderManage",
      },
      isIndeterminate: false,
      checkAll: false,
      // 表格数据删除展示结构
      tableDeleteConfig: {
        columns: [
          {
            label: "品牌名称",
            prop: "name",
            type: "",
          },
          {
            label: "绑定商品数",
            prop: "productCount",
            type: "",
          },
        ],
      },

      mixinTable_tableSearchData: {
        orderNo: "",
      },

      // 列表高级查询参数
      mixinTable_tableSearchSenior: {
        // 订单状态
        orderStatus: {
          type: Number,
          value: 0,
          default: 0,
        },

      },

      options: [
        {
          value: 0,
          label: "全部",
        },
        {
          value: 1,
          label: "待支付",
        },
        {
          value: 2,
          label: "拼团中",
        },
        {
          value: 3,
          label: "待发货",
        },
        {
          value: 4,
          label: "待收货",
        },
        {
          value: 5,
          label: "待评价",
        },
        {
          value: 6,
          label: "已完成",
        },
        {
          value: 7,
          label: "已取消",
        },
      ],
      value: "",
    };
  },
  methods: {
    handleCheckAllChange(val) {
      let _list = [];
      if (val) {
        this.mixinTable_tableData.forEach((item) => {
          _list.push(item.id);
        });
      }
      this.mixinTable_selectTableData = _list;
      this.isIndeterminate = false;
    },
    clearSelection() {
      this.isIndeterminate = false;
      this.checkAll = false;
      this.mixinTable_selectTableData = [];
    },
    handleCheckedChange(value) {
      // console.error(value)
      let checkedCount = value.length;
      this.checkAll = checkedCount === this.mixinTable_tableData.length;
      this.isIndeterminate =
        checkedCount > 0 && checkedCount < this.mixinTable_tableData.length;
    },

    // 初始化
    async init() {
      // 刷新表格数据，此方法扩展时可重写
      this.mixinTable_refreshData();
    },

    statusChange() {
      this.mixinTable_refreshData();
    },
  },
  mounted() {
    this.init();
  },
  created() {
    // 默认选中拼团中状态
    this.mixinTable_tableSearchSenior.orderStatus.value = 2;
  },
  activated() {},
};
</script>